package 内存模型;

import java.util.ArrayList;
import java.util.List;
import java.util.TimerTask;

public class OutOfMemoryErrorTest {

    public static void main(String[] args) {
        runOutMemory();
    }

    /**
     * 设置堆内存大小为20m
     * -Xms20M -Xmx20M
     */
    public  static void runOutMemory(){
        List<OutOfMemoryErrorTest> lit=new ArrayList<>();
        while (true){
            System.out.println("-->");
            lit.add(new OutOfMemoryErrorTest());

        }
    }

}
